<?php

class HModules {
	function getModuleNameById($instance_id) {
		$a = HSql::fetch2Array(HSql::doQuery("SELECT id, module_id FROM portal_modules_instances WHERE id = '$instance_id'"));
		$b = HSql::fetch2Array(HSql::doQuery("SELECT id, module_name FROM portal_modules WHERE id = '".$a[0]['module_id']."'"));		
		if (count($b) == 0) return null;
		else return $b[0]['module_name'];
	}
}